package com.ad.pet.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

import com.ad.pet.R;

/**
 * Created by SEELE on 2019/5/30.
 */

public class RedBagCashDialog extends Dialog {


    public RedBagCashDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);

        initView(context);
    }

    private void initView(Context context) {
        View view = View.inflate(context, R.layout.layout_red_bag_cash_dialog,null);
        ImageView imageViewClose =  view.findViewById(R.id.iv_close);

        imageViewClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });


        setContentView(view);



        Window window = this.getWindow();
//        WindowManager.LayoutParams lp = window.getAttributes();
//        lp.width = LyxUtils.dp2px(getContext(),330);
//        lp.height = LyxUtils.dp2px(getContext(),270);
//        this.getWindow().setAttributes(lp);
        window.setGravity(Gravity.CENTER);
    }
}
